<@nerve.header title="二手车列表">
</@nerve.header>
<script>
	var p = {};
	p['brand'] = '${page.brand!''}';
	p['price'] = '${page.price!''}';
	p['mileage'] = '${page.mileage!''}';
	p['shift'] = '${page.shift!''}';
	p['grade'] = '<#if page.grade gt 0>${page.grade}</#if>';
	p['categoryId'] = '<#if page.categoryId gt 0>${page.categoryId}</#if>';
	p['type'] = '${page.type!''}';
	p['year'] = '${page.year!''}';
	
	function c(n,v){
		p[n]=v;
		
		var loca = "";
		for(var k in p){
			if(p[k]!='')
				loca +="&"+k+"="+p[k];
		}
		if(loca!='')
			loca=loca.substring(1,loca.length);
		window.location.href = "${base}/list.do?"+loca;
	}
	
	var cs=['&','#','@','(',')','[',']','{','}'];
	$(document).ready(function(){
		for(var k in p){
			var n=p[k];
			for(var i=0;i<cs.length;i++)
				n=n.replace(cs[i], "\\"+cs[i]);
			$("dd[k="+k+"_"+n).addClass("selected");
		}
	});
</script>
<!--//class ic-nav-->
<div class="bread-nav">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="${base}/">首页</a></li>
            <li class="active">全部车型</li>
        </ol>
    </div>
</div>
<div class="mod-select">
    <div class="container sub-cat-box">
        <ul class="select-content clearfix">
            <li class="select-list">
                <dl id="s1">
                    <dt>品牌：</dt>
                    <dd class="select-all" k="brand_">
                    	<a href="javascript:;" onclick="c('brand','')">不限</a>
					</dd>
					<#list page.brands as b>
					<dd k="brand_${b.name}">
						<a href="javascript:;" onclick="c('brand','${b.name!''}');" >
							${b.name!''}
						</a>
					</dd>
					</#list>
                </dl>
            </li>
            <li class="select-list">
                <dl id="s2">
                    <dt>价格：</dt>
                    <dd class="select-all" k="price_"><a href="javascript:;" onclick="c('price','')">不限</a></dd>
                    <dd k="price_0-3"><a href="javascript:;" onclick="c('price','0-3')">3万以下</a></dd>
                    <dd k="price_3-5"><a href="javascript:;" onclick="c('price','3-5')">3-5万</a></dd>
                    <dd k="price_5-8"><a href="javascript:;" onclick="c('price','5-8')">5-8万</a></dd>
                    <dd k="price_8-12"><a href="javascript:;" onclick="c('price','8-12')">8-12万</a></dd>
                    <dd k="price_12-16"><a href="javascript:;" onclick="c('price','12-16')">12-16万</a></dd>
                    <dd k="price_16-25"><a href="javascript:;" onclick="c('price','16-25')">16-25万</a></dd>
                    <dd k="price_25-35"><a href="javascript:;" onclick="c('price','25-35')">25-35万</a></dd>
                    <dd k="price_35-"><a href="javascript:;" onclick="c('price','35-')">35万以上</a></dd>
                </dl>
            </li>
            <li class="select-list">
                <dl id="s3">
                    <dt>里程：</dt>
                    <dd k="mileage_" class="select-all"><a href="javascript:;" onclick="c('mileage','')">不限</a></dd>
                    <dd k="mileage_0-2"><a href="javascript:;" onclick="c('mileage','0-2')">2万公里以内</a></dd>
                    <dd k="mileage_2-5"><a href="javascript:;" onclick="c('mileage','2-5')">2-5万公里</a></dd>
                    <dd k="mileage_5-10"><a href="javascript:;" onclick="c('mileage','5-10')">5-10万公里</a></dd>
                    <dd k="mileage_10-"><a href="javascript:;" onclick="c('mileage','10-')">10万公里以上</a></dd>
                </dl>
            </li>
            <li class="select-list">
                <dl id="s4">
                    <dt>变速箱：</dt>
                    <dd k="shift_" class="select-all"><a href="javascript:;" onclick="c('shift','')">不限</a></dd>
					<#list car_shift as cc>
					<dd k="shift_${cc}" class=""><a href="javascript:;" onclick="c('shift','${cc}')">${cc}</a></dd>
					</#list>
                </dl>
            </li>
            <li class="select-list">
                <dl id="s5">
                    <dt>车况：</dt>
                    <dd k="grade_" class="select-all"><a href="javascript:;" onclick="c('grade','')">不限</a></dd>
                    <dd k="grade_2"><a href="javascript:;" onclick="c('grade','2')">良好</a></dd>
					<dd k="grade_3"><a href="javascript:;" onclick="c('grade','3')">优秀</a></dd>
                    <dd k="grade_4"><a href="javascript:;" onclick="c('grade','4')">极优+</a></dd>
					<dd k="grade_5"><a href="javascript:;" onclick="c('grade','5')">极优</a></dd>
                    <dd k="grade_6"><a href="javascript:;" onclick="c('grade','6')">优秀+</a></dd>
                </dl>
            </li>
            <li class="select-list">
                <dl id="s6">
                    <dt>分类：</dt>
                    <dd k="categoryId_" class="select-all"><a href="javascript:;" onclick="c('categoryId','')">不限</a></dd>
					<#list page.categorys as c>
					<dd k="categoryId_${c.id}"><a href="javascript:;" onclick="c('categoryId','${c.id}')">${c.name}</a></dd>
		            </#list>
                </dl>
            </li>
            <li class="select-list">
                <dl id="s7">
                    <dt>车身类型：</dt>
                    <dd k="type_" class="select-all"><a href="javascript:;" onclick="c('type','')">不限</a></dd>
					<#list car_category as cc>
					<dd k="type_${cc}" class=""><a href="javascript:;" onclick="c('type','${cc}')">${cc}</a></dd>
					</#list>
                </dl>
            </li>
            <li class="select-list">
                <dl id="s8">
                    <dt>车龄：</dt>
                    <dd k="year_" class="select-all"><a href="javascript:;" onclick="c('year','')">不限</a></dd>
                    <dd k="year_0-1"><a href="javascript:;" onclick="c('year','0-1')">1年内</a></dd>
                    <dd k="year_1-2"><a href="javascript:;" onclick="c('year','1-2')">1-2年</a></dd>
                    <dd k="year_2-3"><a href="javascript:;" onclick="c('year','2-3')">2-3年</a></dd>
                    <dd k="year_3-5"><a href="javascript:;" onclick="c('year','3-5')">3-5年</a></dd>
                    <dd k="year_5-"><a href="javascript:;" onclick="c('year','5-')">5年以上</a></dd>
                </dl>
            </li>
            <li class="select-result">
                <dl>
                    <dt>已选条件：</dt>
                    <dd class="select-no">暂时没有选择过滤条件</dd>
                </dl>
            </li>
            <li class="text-center">
                <a class="show-more" href="#">展开筛选条件</a>
            </li>
        </ul>
    </div>
    <!--//class container-->
</div>
<!--//class mod-select-->

<div class="car-list-main">
    <div class="container">
        <div class="result-list clearfix">
            <#list page.list as c>
			<div class="car-item <#if c_index==0>first-item</#if>">
                <div class="car-img">
                    <a href="detail.do?id=${c.id}" target="_blank" title="${c.fullName!''}">
                        <img src="${base}${c.firstPicture!def_carPicture}" alt="${c.fullName!''}">
                    </a>
                    <#if c.status == 0>
					<span class="cl cl-${c.report.grade}"><@nerve.show_grade key=c.report.grade /></span>
					</#if>
                </div>
                <div class="car-info">
                    <div class="car-price">
                        <span class="price">
                        	<#if c.status == 0>
							${c.price}<em>万元</em>
							<#else>
							已售							
							</#if>
                        </span>
						<#if c.alias??>
						<span class="carNum">编号：${c.alias}</span>
						</#if>
                    </div>
                    <div class="car-link">
                        <a href="detail.do?id=${c.id}" target="_blank" title="${c.fullName!''}">
                        	<#if c.fullName?length gt 20>${c.fullName[0..19]}..<#else>${c.fullName}</#if>
						</a>
                    </div>
                    <div class="car-details">
                        <p>${c.plateDate!''}上牌<br>里程：${c.mileage!''}万公里</p><a href="detail.do?id=${c.id}" target="_blank" class="list-btn">查看详情</a>
                    </div>
                </div>
            </div>
			</#list>
        </div>
		<@common.pagination />
        <!--//class result-list-->

        <@nerve.storeList />
    </div>
    <!--//class container-->
</div>

<@nerve.footer>
<script type="text/javascript">
    $(function(){
        var $ca = $(".select-content li:gt(4):not(:last)");
        $ca.hide();
        var $togBtn = $(".show-more");

        $togBtn.click(
                function(){
                    if($ca.is(":visible")){
                        $ca.slideUp('fast');
                        $(this).text("展开筛选条件");
                    }else {
                        $ca.slideDown('fast');
                        $(this).text("收起筛选条件");
                    }
                    return false;
                }
        );
    })
</script>
</@nerve.footer>
